package rexsee.core.utilities;

import rexsee.core.browser.Browser;
import rexsee.core.browser.clazz.JavascriptInterface;

public class RexseeString implements JavascriptInterface {

	public static final String INTERFACE_NAME = "String";
	@Override
	public String getInterfaceName() {
		return mBrowser.application.resources.prefix + INTERFACE_NAME;
	}
	@Override
	public JavascriptInterface getInheritInterface(Browser childBrowser) {
		return this;
	}
	@Override
	public JavascriptInterface getNewInterface(Browser childBrowser) {
		return this;
	}

	private final Browser mBrowser;

	public RexseeString(Browser browser) {
		mBrowser = browser;
	}

	//JavaScript Interface
	public String replace(String string, String find, String replace) {
		return string.replace(find, replace);
	}

}
